/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package elderberryni2.datareader;

import elderberryni2.interfaces.IDataReadable;

/**
 *
 * @author warringer
 */
public class DataReader implements IDataReadable{
    
    private IDataReadable dataSource;
    
    public DataReader(IDataReadable source) {
        this.dataSource = source;
    }

    public IDataReadable getDataSource() {
        return dataSource;
    }

    public void setDataSource(IDataReadable dataSource) {
        this.dataSource = dataSource;
    }

    @Override
    public String getData() {
        String data = this.dataSource.getData();
        if (data.contains("#")) {
            data = null;
        }
        return data;
    }

    @Override
    public void pauseData() {
        this.dataSource.pauseData();
    }

    @Override
    public void unpauseData() {
        this.dataSource.unpauseData();
    }

    @Override
    public void close() {
        this.dataSource.close();
    }
        
}
